home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power Programmierung
/
Power-Programmierung CD 2 (Tewi)(1994).iso
/
c
/
compiler
/
small_c
/
byte_sc
/
strncmp.c
< prev
next >
Wrap
Text File
|
1987-10-04
|
384b
|
14 lines
/*
** strncmp(s,t,n) - Compares two strings for at most n
** characters and returns an integer
** >0, =0, or <0 as s is >t, =t, or <t.
*/
strncmp(s, t, n) char *s, *t; int n; {
while(n && *s==*t) {
if (*s == 0) return (0);
++s; ++t; --n;
}
if(n) return (*s - *t);
return (0);
}